﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Reflection;
using System.IO;
using Wys.DataForm.CSharp.SoftWare;

namespace Wys.DataForm.CSharp
{
    public partial class SoftWareList : Wys.Control.Vb.AutoAdjustFrom
    {
        public SoftWareList()
        {
            InitializeComponent();
        }
        Wys.Control.Vb.TreeTableFromBase ttf = null;
        private string strFilePath = String.Empty;
        private string strFolder = string.Empty;

        private string strFilePath同步 = String.Empty;
        private string strFolder同步 = string.Empty;
        //A-2009-09-06
        private string strFileName = String.Empty;
        private string strLastfenlei = string.Empty;
        //A-2009-09-06

        //A-2009-09-08
        FindFormSoftWare _findForm = new FindFormSoftWare(); //增加查找窗口 A-2010-01-10
        public int iListToUpdate = -1;//增加查找窗口 A-2010-01-10
        String strSql = "";
        String strSql1 = "";
        struct DataWindowPage
        {
            public String lanagerName;
            public String windowPage;
            public String LanagerName
            {
                get
                {
                    return lanagerName;
                }
                set
                {
                    lanagerName = value;
                }

            }
            public String WindowPage
            {
                get
                {
                    return windowPage;
                }
                set
                {
                    windowPage = value;
                }
            }
        }
        //A-2009-09-08

        //A-2009-09-11
        public String strId = String.Empty;
        //A-2009-09-11

        //A-2010-02-21
        private bool _软件图标 = false;
        private bool _软件大小 = false;
        //A-2010-02-21
        private void SoftWareList_Load(object sender, EventArgs e)
        {
            //if (GetAppSettingConfig("ShowStausBar") == "1")
            //{
            //    if (su == null)
            //    {
            //        cUtil.CreateStausStrip(this, ref su, ref sup);
            //    }
            //}
            _软件图标 = true;
            //this.Visible = false ;
            //A-2010-02-21
            //using(CSharpMain.PR.SoftwareOption so=new CSharpMain.PR.SoftwareOption())
            //{
            //    so.ShowDialog();
                
            //    _软件大小 = so.软件大小;
            //}
            //this.Visible = true;
            //A-2010-02-21

            //A-2009-10-11
            if (GetAppSettingConfig("BrowserOtherUserData") != "1")
            {
                this.lstView.UserNameValue = this.strName;
                this.lstView.UserName = "USERNAME";
                this.lstView.BrowserData = false;
            }
            else
            {
                this.lstView.UserNameValue = this.strName;
                this.lstView.UserName = "USERNAME";
                this.lstView.BrowserData = false;
            }
            //A-2009-10-11
            LoadInitData();       
            this.RefreshData();

            //增加查找窗口 A-2010-01-10
            SetFindForm((Wys.Control.Vb.FindForm)_findForm);

            if (Directory.Exists(GetAppSettingConfig("synchronizatePath")))
            {
                button1.Enabled = true;
            }
            else
            {
                try
                {
                    Directory.CreateDirectory(GetAppSettingConfig("synchronizatePath"));
                }
                catch (Exception)
                {

                }
                button1.Enabled = false;
            }
            if (Directory.Exists(GetAppSettingConfig("synchronizatePath")))
            {
                button1.Enabled = true;
            }
            else
            {
                button1.Enabled = false;
            }
            ttf = new Wys.Control.Vb.TreeTableFromBase(this.cboSoftWareType.Tag.ToString());
            ttf.ID = "ID";
            ttf.ParentID = "ParentID";
            ttf.DisplayName = "Name";
            ttf.TableName = "XscBugType";
            ttf.Text = "网址类型选择";
            ttf.TypeId = 15;           
            ttf.是否关联 = true;
            ttf.Width -= 70;
            ttf.Height -= 20;
            ttf.是不是附加启动 = true;
            ttf.SelectData += new Wys.Control.Vb.TreeTableFromBase.SelectDataEventHandler(ttf_SelectData);
            ttf.Show(this.Owner);
            ttf.Left = this.Left - ttf.Width;
            ttf.Top = this.Top;

            //ttf = new Wys.Control.Vb.TreeTableFromBase(this.cboSoftWareType.Tag.ToString());
            //ttf.ID = "ID";
            //ttf.ParentID = "ParentID";
            //ttf.DisplayName = "Name";
            //ttf.TableName = "XscSoftWareType";
            //ttf.Text = "请选择软件类型";
            //ttf.是否关联 = true;
            //ttf.Width -= 70;
            //ttf.Height -= 20;
            //ttf.是不是附加启动 = true;
            //ttf.SelectData+=new Wys.Control.Vb.TreeTableFromBase.SelectDataEventHandler(ttf_SelectData);
            //ttf.Show(this.Owner);
            //ttf.Left = this.Left - ttf.Width;
            //ttf.Top = this.Top;
           
            Application.DoEvents();
            this.RefreshData();
        }

        private void ttf_SelectData( String result , String  DisplayNameValue)
        {
            strLastfenlei = result;
            cboSoftWareType.Text = ttf.DisplayNameValue;
            cboSoftWareType.Tag = ttf.Result;
            this.RefreshData();
        }
        #region 窗体加载时的初始数据
        public void LoadInitData()
        {
            
            //DataTable dt = ct.FillTable("select Name,FolderPath from XscSoftWareType");
            //this.cboSoftWareType.DisplayMember = "Name";
            //this.cboSoftWareType.DataSource = dt;
            //A-2009-09-08
            SetLangager();
            if(ExistConvertCode())
            {
                cboLanager.Enabled=true;
                btnOpenNeiMa.Enabled=true;
                btnShortCut.Enabled=true;
                btn快捷方式内码模式所有.Enabled = true;
                btn快捷方式所有内码所有.Enabled = true;
            }else
            {
                cboLanager.Enabled=false;
                btnOpenNeiMa.Enabled=false;
                this.btnShortCutNeima.Enabled=false;
                btn快捷方式内码模式所有.Enabled = false;
                btn快捷方式所有内码所有.Enabled = false;
            }
            //A-2009-09-08
        }
        #endregion

        #region 加载数据函数
        public void LoadData()
        {
            //A-2009-10-11
            if (GetAppSettingConfig("BrowserOtherUserData") != "1")
            {
                this.lstView.UserNameValue = this.strName;
                this.lstView.UserName = "USERNAME";
                this.lstView.BrowserData = false;
            }
            else
            {
                this.lstView.UserNameValue = this.strName;
                this.lstView.UserName = "USERNAME";
                this.lstView.BrowserData = false;
            }
            //A-2009-10-11
            try
            {
                String strSql = "select ID,Title               from XscSoftWare Where 1=1 Order by LastOpenTime Desc";
                String strSql1 = "select count(*) as PageCount from XscSoftWare Where 1=1 Order by LastOpenTime Desc";
                lstView.SetRsSQLITE(strSql, strSql1, ct, 1);
            }
            catch (Exception ee)
            {
                //SaveException(ee);//D-2009-10-11
                UTIL.CException.SaveExcepiton(UTIL.ErrorType.Error, ee, MethodBase.GetCurrentMethod().GetType());//A-2009-10-11 
            }

        }
        #endregion        

        private void cboSoftWareType_ItemChanged(string strText)
        {
            //A-2009-10-11
            if (GetAppSettingConfig("BrowserOtherUserData") != "1")
            {
                this.lstView.UserNameValue = this.strName;
                this.lstView.UserName = "USERNAME";
                this.lstView.BrowserData = false;
            }
            else
            {
                this.lstView.UserNameValue = this.strName;
                this.lstView.UserName = "USERNAME";
                this.lstView.BrowserData = false;
            }
            //A-2009-10-11
            String strSql = "";
            String strSql1 = "";
            if (strText.ToUpper() == "ALL")
            {
                strSql = "select ID,Title               from XscSoftWare Where 1=1 Order by LastOpenTime Desc";
                strSql1 = "select count(*) as PageCount from XscSoftWare Where 1=1 Order by LastOpenTime Desc";
            }
            else
            {
                strSql = "select ID,Title               from XscSoftWare Where 1=1 And SoftWare='" + strText + "'  Order by LastOpenTime Desc";
                strSql1 = "select count(*) as PageCount from XscSoftWare Where 1=1 And SoftWare='" + strText + "'  Order by LastOpenTime Desc";
            }
            lstView.SetRsSQLITE(strSql, strSql1, ct, 1);
           
        }

        private void lstView_ItemClickRefreshData(string strId,ref bool bState)
        {
            
            //A-2009-09-11
            this.strId = strId;
            //A-2009-09-11
            //查询数据
            //String strSql = " select FileName,FolderPath ,Memo from XscSoftWare "; //D-2009-10-11
            String strSql = " select * from XscSoftWare "; //A-2009-10-11
            strSql += "       where      XscSoftWare.Id='" + strId+"'";
            btnOpen.Enabled = false;
            //2009-08-17
            strFolder=String.Empty;
            btnFolder.Enabled = false;
            btnShortCut.Enabled = false;
            this.lblMemo.Text = "";
            this.lstFileName.Text = "";
            groupBox2.Enabled = false;
            //2009-08-17
            //A-2009-09-06
            strFileName = "";
            //A-2009-09-06
            strFilePath = "";
            strFilePath同步 = "";
            strFolder同步 = "";
            ADODB.Recordset rs = ct.GetTable(strSql);     
            if (rs != null)
            {
                if (rs.EOF == false)
                {
                    cUtil.RefreshTitle(su, rs.Fields["USERNAME"].Value + "", rs.Fields["AddTime"].Value + "", rs.Fields["OPTIME"].Value + "", strId);
                    //A-2009-10-11
                    if ((rs.Fields["USERNAME"].Value + "").ToString() != this.strName)
                    {
                        this.btnUpdate.Enabled = false;
                    }
                    else
                    {
                        this.btnUpdate.Enabled = true;
                    }
                    //A-2009-10-11
                    btnOpen.Enabled = true;
                    //2009-08-17
                    btnFolder.Enabled = true;
                    //2009-08-17
                    //A-2009-09-06
                    btnShortCut.Enabled = true;

                    //A-2009-10-27
                    btnOpenNeiMa.Enabled = true;
                    btnShortCutNeima.Enabled = true;
                    //A-2009-10-27

                    //A-2009-09-06
                    //配置路径
                    String strBasePath = this.GetAppSettingConfig("SoftWarePath");
                    strBasePath = System.IO.Path.Combine(this.GetCurrentDirectory(), strBasePath);

                    strBasePath = 得到小软件文件夹路径();
                    //strBasePath = System.IO.Path.Combine(strBasePath, rs.Fields["FolderPath"].Value.ToString());
                    strBasePath = System.IO.Path.Combine(strBasePath, rs.Fields["FileName"].Value.ToString());

                    strFilePath同步 = this.GetAppSettingConfig("SoftWarePath");
                    strFilePath同步 = System.IO.Path.Combine(this.GetAppSettingConfig("synchronizatePath"), strFilePath同步);
                    //strFilePath同步 = System.IO.Path.Combine(strFilePath同步, rs.Fields["FolderPath"].Value.ToString());
                    strFilePath同步 = System.IO.Path.Combine(strFilePath同步, rs.Fields["FileName"].Value.ToString());
                    if (System.IO.File.Exists(strFilePath同步))
                    {
                        System.IO.FileInfo fi = new System.IO.FileInfo(strFilePath同步);
                        strFolder同步 = fi.DirectoryName;
                        groupBox2.Enabled = true;
                        if (!ExistConvertCode())
                        {
                            btn同步目录打开内码.Enabled = false;
                            btn同步目录快捷方式内码.Enabled = false;
                        }
                    }else
                    {
                        groupBox2.Enabled=false;
                    }

                    //2010-04-05
                    RefreshEBook(strBasePath,rs.Fields["IsSingleFile"].Value.ToString());
                    //2010-04-05
                    if (System.IO.File.Exists(strBasePath))
                    {
                        
                        strFilePath = strBasePath;

                        //2009-08-17
                        System.IO.FileInfo fi = new System.IO.FileInfo(strBasePath);
                        strFolder = fi.DirectoryName;

                        //A-2009-09-06
                        strFileName = fi.Name.Substring(0,fi.Name.Length-fi.Extension.Length-1);
                        //A-2009-09-06

                        this.lblMemo.Text = rs.Fields["Memo"].Value.ToString();
                        this.lstFileName.Text = fi.Name;
                        //2009-08-17

                        //A-2009-10-27
                        if (!ExistConvertCode())
                        {
                            btnOpenNeiMa.Enabled = false;
                            btnShortCutNeima.Enabled = false;
                        }
                        //A-2009-10-27

                        //A-2010-02-05
                        try
                        {
                            Icon ic = Icon.ExtractAssociatedIcon(fi.FullName);
                            this.pictureBox1.Image = ic.ToBitmap() as Image;
                        }
                        catch (Exception me)
                        {
                            UTIL.CException.SaveExcepiton(UTIL.ErrorType.Error, me, MethodBase.GetCurrentMethod().GetType());//A-2009-10-11 
                        }
                        //A-2010-02-05


                      
                    }//2009-08-17
                    else
                    {
                        btnFolder.Enabled = false;
                        btnOpen.Enabled = false;
                        //A-2009-09-06
                        btnShortCut.Enabled =false;
                        //A-2009-09-06
                        strFolder = "";
                        strFilePath = "";
                        this.lstFileName.Text = "";
                        this.lblMemo.Text = "";
                        //A-2009-09-06
                        strFileName = "";
                        //A-2009-09-06

                        //A-2009-09-25
                        btnOpenNeiMa.Enabled = false;
                        btnShortCutNeima.Enabled = false;
                        //A-2009-09-25
                    }//2009-08-17
                    
                    rs.Close();
                }
            }
            rs = null;
        }

        private void btnOpen_Click(object sender, EventArgs e)
        {
            //D-2009-10-07
            //try
            //{
            //    if (string.IsNullOrEmpty(strFilePath))
            //    {
            //        return;
            //    }
            //    Process p = new Process();
            //    p.StartInfo.FileName = strFilePath;
            //    p.StartInfo.UseShellExecute = true;
            //    p.StartInfo.RedirectStandardOutput = true;
            //    p.StartInfo.CreateNoWindow = true;
            //    p.Start();  
            //}
            //catch (Exception me)
            //{
            //    try
            //    {
            //        System.Diagnostics.Process.Start(strFilePath);
            //    }
            //    catch (Exception mep)
            //    {
            //        SaveException(mep);
            //    }
               
            //}
            //D-2009-10-07

            if (!strFilePath.ToLower().EndsWith(".jar"))
            {
                UTIL.CUtil.OpenFile(strFilePath); //A-2009-10-07
            }
            else
            {
                UTIL.CUtil.OpenFile(System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("JAVA_HOME",EnvironmentVariableTarget.Machine),@"bin\java.exe"), " -jar " + strFilePath); //A-2009-10-07
            }

            //2010-04-11 打开时记录最后一次打开功能           
            String strSql2 = "update XscSoftWare set LastOpenTime=?  where id='" + this.strId + "'";
            ADODB.Command cmd = new ADODB.Command();
            cmd.CommandText = strSql2;
            ADODB.Parameter pa = cmd.CreateParameter("", ADODB.DataTypeEnum.adDBTimeStamp, ADODB.ParameterDirectionEnum.adParamInput, -1, DateTime.Now.ToString());
            cmd.Parameters.Append(pa);
            ct.ExcCommand(cmd);
            //2010-04-11 打开时记录最后一次打开功能
        }

        private void btnFolder_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(strFolder))
                {
                    return;
                }
                //System.Diagnostics.Process.Start(strFolder); //D-2009-10-07
                //UTIL.CUtil.OpenFile(strFolder); //A-2009-10-07 //D-2010-02-14 修正功能打开文件夹选中文件的功能
                UTIL.CUtil.OpenFileSetFile(strFilePath,""); //A-2010-02-14
            }
            catch (Exception me)
            {
                //SaveException(me);//D-2009-10-11
                UTIL.CException.SaveExcepiton(UTIL.ErrorType.Error, me, MethodBase.GetCurrentMethod().GetType());//A-2009-10-11 
            }
        }

        #region 创建快捷方式 A-2009-09-06
        private void btnShortCut_Click(object sender, EventArgs e)
        {
            if (UTIL.LnkFileClass.CreateLnkFile(strFileName, strFilePath, "","",""))
            {
                ShowMessageBox("创建成功");
            }
            else
            {
                ShowMessageBox("创建失败");
            }
        }
        #endregion

        #region 检测内码转换软件 APPPATCH A-2009-09-08
        public bool ExistConvertCode()
        {
            String strPath = Environment.GetEnvironmentVariable("windir");
            //String strPath = this.GetCurrentDirectory();
            strPath = System.IO.Path.Combine(strPath, @"AppPatch\AppLoc.exe");
            if(System.IO.File.Exists(strPath))
            {
                return true;
            }
            return false;
        }
        #endregion

        #region 得到内码转换软件 APPPATCH A-2009-09-08
        public String  GetConvertCode()
        {
            String strPath = Environment.GetEnvironmentVariable("windir");
            strPath = System.IO.Path.Combine(strPath, @"AppPatch\AppLoc.exe");
            //String strPath = this.GetCurrentDirectory();
            //strPath = System.IO.Path.Combine(strPath, @"apploc\AppPatch\AppLoc.exe");
            if (System.IO.File.Exists(strPath))
            {
                return strPath;
            }
            return "";
        }
        #endregion

        #region 设置区域语言 APPPATCH A-2009-09-08
        private void SetLangager()
        {
            List<DataWindowPage> lst = new List<DataWindowPage>();         
            DataWindowPage dwp = new DataWindowPage();

            dwp.lanagerName = "Chinese (Simplified)";
            dwp.windowPage = "0804";
            lst.Add(dwp);

            dwp.lanagerName = "Chinese (Traditional)";
            dwp.windowPage = "0404";
            lst.Add(dwp);

            dwp.lanagerName = "English (default)";
            dwp.windowPage = "0409";
            lst.Add(dwp);

            dwp.lanagerName = "Japanese";
            dwp.windowPage = "0411";
            lst.Add(dwp);

            dwp.lanagerName = "Korean";
            dwp.windowPage = "0412";
            lst.Add(dwp);

            dwp.lanagerName = "German";
            dwp.windowPage = "0407";
            lst.Add(dwp);            

            cboLanager.DataSource = lst;
            cboLanager.DisplayMember = "LanagerName";            

        }
        #endregion

        #region 打开(内码转换模式) A-2009-09-08
        private void btnShortCutNeima_Click(object sender, EventArgs e)
        {
            try
            {
                DataWindowPage ob = (DataWindowPage)cboLanager.SelectedValue;
                String strPath1 = GetConvertCode();
                String strArgument= "\"" + strFilePath + "\"" + "  \"/L" + ob.WindowPage + "\"";
                if (UTIL.LnkFileClass.CreateLnkFile(strFileName, strPath1, "",strArgument,strFilePath))
                {
                    ShowMessageBox("创建成功");
                }
                else
                {
                    ShowMessageBox("创建失败");
                }
            }
            catch (Exception me)
            {
                //SaveException(me);//D-2009-10-11
                UTIL.CException.SaveExcepiton(UTIL.ErrorType.Error, me, MethodBase.GetCurrentMethod().GetType());//A-2009-10-11 
            }
        }
        #endregion

        #region 快捷方式(内码转换模式) A-2009-09-08
        private void btnOpenNeiMa_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(strFilePath))
                {
                    return;
                }
                //D-2009-10-07 
                //System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(GetConvertCode());
                DataWindowPage ob = (DataWindowPage)cboLanager.SelectedValue;
                //psi.Arguments = "\"" + strFilePath + "\"" + "  \"/L" + ob.WindowPage + "\"";
                //System.Diagnostics.Process.Start(psi);
                //D-2009-10-07         
                UTIL.CUtil.OpenFile(GetConvertCode(), "\"" + strFilePath + "\"" + "  \"/L" + ob.WindowPage + "\""); //A-2009-10-07
            }
            catch (Exception)
            {

            }
                      
        }
        #endregion

        #region 安装内码转换软件 A-2009-09-08
        private void btnInstall_Click(object sender, EventArgs e)
        {
            try
            {
                String strpath = System.IO.Path.Combine(this.GetCurrentDirectory(), @"apploc\apploc.msi");
                if (System.IO.File.Exists(strpath))
                {
                    System.Diagnostics.Process.Start(strpath);
                }
            }
            catch (Exception)
            {

            }
        }
        #endregion       

        #region 添加按钮 A-2009-09-11
        private void btnIns_Click(object sender, EventArgs e)
        {
            SoftWareAdd frm = new SoftWareAdd();
            //A-2009-10-10
            frm.strName = this.strName;
            frm.iType = this.iType;
            //A-2009-10-10
            frm.ShowDialog();
            if (frm.bAdd)
            {
                //cboSoftWareType_ItemChanged(this.cboSoftWareType.Text);
                this.RefreshData();
            }
        }
        #endregion

        #region 更新记录按钮 A-2009-09-11
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            String strSql = "select ID,TITLE  from XscSoftWare Where ID='" + this.strId + "'";
            String strSql1 = "select count(*) as PageCount from XscSoftWare  Where ID='" + this.strId + "'";
            SoftWareListUpdate frm = new SoftWareListUpdate();
            frm.iType = this.iType;
            frm.strName = this.strName;
            frm.iListToUpdate = 0;
            frm.LoadListToUpdate(strSql, strSql1);
            frm.ShowDialog();
            this.RefreshData();
            //cboSoftWareType_ItemChanged(this.cboSoftWareType.Text);
        }
        #endregion

        #region 类型选择按钮
        private void btnSelectType_Click(object sender, EventArgs e)
        {
            Wys.Control.Vb.TreeTableFromBase ttf = new Wys.Control.Vb.TreeTableFromBase(this.cboSoftWareType.Tag.ToString());
            ttf.ID = "ID";
            ttf.ParentID = "ParentID";
            ttf.DisplayName = "Name";
            ttf.TableName = "XscSoftWareType";
            ttf.Text = "请选择软件类型";
            ttf.ShowDialog();
            if (!ttf.Cancel)
            {
                cboSoftWareType.Text = ttf.DisplayNameValue;
                cboSoftWareType.Tag = ttf.Result;
            }
            this.RefreshData();
        }
        #endregion
        
        private void RefreshData()
        {
            String str = "";
            String[] strResult = GetChildIdAndSelf(cboSoftWareType.Tag.ToString());
            
            foreach (String strItem in strResult)
            {
                str = str + "'" + strItem + "',";
            }

            if (str == "")
            {
                str = "'" + cboSoftWareType.Text + "'";
            }
            else
            {
                if (str.EndsWith(","))
                {
                    str = str.Substring(0, str.Length - 1);
                }
            }
            FormClear();
            LoadData(str);
            lstView_EventPageComplete();
        }
        public void FormClear()
        {
            //txtTitle.Text = "";
            //cboSoftWareType1.Text = "";
            //cboSoftWareType1.Tag = "";
            //txtPath.Text = "";
            //txtPath.Tag = "";
            //this.radFile.Checked = true;
            //txtMemo.Text = "";
        }
        private String[] GetChildIdAndSelf(String strParentId)
        {
            List<String> result = new List<string>();
            if (!result.Contains(strParentId))
            {
                result.Add(strParentId);
            }
            ADODB.Recordset rs = null;
            if (!String.IsNullOrEmpty(strParentId))
            {
                rs = ct.GetTable("select ID from XscBugType where ParentID='" + strParentId + "'");
            }
            else
            {
                rs = ct.GetTable("select ID from XscBugType where ParentID is null and type=15");
            }
            if (rs == null)
            {
                return null;
            }
            if (rs.EOF)
            {
                goto end1;
            }
            String str = "";
            String strid1 = "";
            while (!rs.EOF)
            {
                str = rs.Fields["ID"].Value.ToString();
                strid1 = rs.Fields["ID"].Value.ToString();
                if (!result.Contains(str))
                {
                    result.Add(str);
                }
                String[] resultChid = GetChildIdAndSelf(strid1);
                if (null == resultChid)
                {
                    goto end2;
                }
                foreach (String strItem in resultChid)
                {
                    if (!result.Contains(strItem))
                    {
                        result.Add(strItem);
                    }
                }
            end2:
                rs.MoveNext();
            }
        end1:
            rs.Close();
            rs = null;
            return result.ToArray();
        }

        public void LoadData(String arrListResult)
        {
            //A-2010-02-05追加图标列
            if (this.lstView.MyDataView1.Columns.Count == 2)
            {

            }
            //A-2010-02-05
            String strSlectSql = "";
            String strCountSql = "";
            if (String.IsNullOrEmpty(arrListResult))
            {
                strSlectSql = "SELECT ID,Title as Title FROM XscSoftWare  Order by LastOpenTime Desc";
                strCountSql = "SELECT count(ID) as PageCount FROM XscSoftWare  Order by LastOpenTime Desc";
            }
            else
            {
                //strSlectSql = "SELECT ID,Title as Title FROM XscSoftWare where SoftWare in(" + arrListResult + ")  Order by LastOpenTime Desc";
                //strCountSql = "SELECT count(ID) as PageCount FROM XscSoftWare where SoftWare in(" + arrListResult + ")  Order by LastOpenTime Desc";
                strSlectSql = "SELECT ID,Title as Title      FROM XscSoftWare where type1 in(" + arrListResult + ") ";
                strSlectSql += " OR  type2 in(" + arrListResult + ") ";
                strSlectSql += " OR  type3 in(" + arrListResult + ") ";
                strSlectSql += " OR  type4 in(" + arrListResult + ") ";
                strSlectSql += " OR  type5 in(" + arrListResult + ") ";
                strSlectSql += " ORDER BY LastOpenTime DESC";

                strCountSql = "SELECT count(ID) as PageCount FROM XscSoftWare where type1 in(" + arrListResult + ")";
                strCountSql += " OR  type2 in(" + arrListResult + ") ";
                strCountSql += " OR  type3 in(" + arrListResult + ") ";
                strCountSql += " OR  type4 in(" + arrListResult + ") ";
                strCountSql += " OR  type5 in(" + arrListResult + ") ";
                strCountSql += " ORDER BY LastOpenTime DESC";
            }
            this.lstView.SetRsSQLITE(strSlectSql, strCountSql, ct, 1);     
        }

        #region 追加查找窗体 A-2009-01-10
        public override void SetFindForm( Wys.Control.Vb.FindForm frm)
        {
            base.SetFindForm( frm);
            _backiListToUpdate = iListToUpdate;
            System.Windows.Forms.ToolStripMenuItem itemMenu = this.ContextMenuStrip1.Items.Add("查找窗口") as System.Windows.Forms.ToolStripMenuItem;
            itemMenu.Click += new EventHandler(查找窗口ToolStripMenuItem_Click);
        }
        public int _backiListToUpdate = -1;
        public override void FindTextForm(string strText, int  itype)
        {
            base.FindTextForm(strText,itype);
            String strFindLikeSql = "";
            FindFormSoftWare findSoftWare = _findForm as FindFormSoftWare;
            if (findSoftWare.radName.Checked)
            {
                strFindLikeSql = GetLikeSql(strText.Trim(), this.strPrexSql, "Title");
                strSql = "select ID,Title as Title FROM XscSoftWare where 1=1 " + strFindLikeSql + " ORDER BY OPTIME DESC";
                strSql1 = "select count(ID) as PageCount FROM XscSoftWare where 1=1 " + strFindLikeSql + " ORDER BY OPTIME DESC";
            }
            else
            {
                strFindLikeSql = GetLikeSql(strText.Trim(), this.strPrexSql, "Memo");
                strSql = "select ID,Title as Title FROM XscSoftWare where 1=1 " + strFindLikeSql + " ORDER BY OPTIME DESC";
                strSql1 = "select count(ID) as PageCount FROM XscSoftWare where 1=1 " + strFindLikeSql + " ORDER BY OPTIME DESC";
            }
            this.iListToUpdate = 1;
            this.lstView.SetRsSQLITE(strSql, strSql1,ct,1);
        }
        public override void FindClose()
        {
           base.FindClose();
           iListToUpdate = _backiListToUpdate;
        }
        private void 查找窗口ToolStripMenuItem_Click(object sender,System.EventArgs e) 
        {
            ShowFindForm();
        }
        #endregion

         public string  GetLikeSql( string  strFind,  string  strPrefix,string  strColumName)
         {
             string  strResult = "";
             strFind = strFind.Replace("//", "");
             strFind = strFind.Replace(" ", "++++");
             strFind = strFind.Replace("　", "++++");
             String[] strSplit = strFind.Split("++++".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);

             if ( strSplit.Length == 1 )
             { //代表没有空格
                    strResult = " AND  " + strColumName + "   LIKE " + strPrefix + "'%" + strFind + "%'";
             }else if ( strSplit.Length >= 1 ) 
             { //代表有空格
                  for ( int I = 0 ; I <= strSplit.Length - 1;I++)
                  {
                        if ((I == 0)) 
                        {
                            strResult += " AND (";
                            strResult += " " + strColumName + "  LIKE  " + strPrefix + "'%" + strSplit[I] + "%' ";
                        }else 
                        {
                            strResult += " AND " + strColumName + "  LIKE  " + strPrefix + "'%" + strSplit[I] + "%' ";
                        }
                        if ((I == strSplit.Length - 1) )
                        {
                            strResult += " ) ";
                        }
                   } 
            }
              return strResult;
         }

         private void lstView_EventPageComplete()
         {
             try
             {
                 //A-2010-02-21
                 if ((!_软件图标)&&(!_软件大小))
                 {
                     return;
                 }
                 //A-2010-02-21


                 //A-2010-02-05追加图标列 
                 if (this.lstView.MyDataView1.Columns.Count == 2)
                 {                     
                     if (_软件图标)
                     {
                         this.lstView.MyDataView1.Columns[1].Width -= 60;
                         DataGridViewImageColumn dic = new DataGridViewImageColumn();
                         dic.Width = 55;
                         dic.HeaderText = "图标";
                         dic.Name = "图标";
                         dic.Visible = true;
                         dic.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
                         this.lstView.MyDataView1.Columns.Add(dic);
                     }

                     if (_软件大小)
                     {
                         this.lstView.MyDataView1.Columns[1].Width -= 65;
                         this.lstView.MyDataView1.Columns.Add("大小", "大小");
                     }
                     this.lstView.MyDataView1.Refresh();
                 }
               
                 for (int i = 0; i < this.lstView.MyDataView1.Rows.Count; i++)
                 {
                     String strSql = " select * From XscSoftWare "; //A-2009-10-11    
                     strSql += "       where      XscSoftWare.Id='" + this.lstView.MyDataView1[0, i].Value.ToString() + "'";

                     ADODB.Recordset rs = ct.GetTable(strSql);
                     if (rs != null)
                     {
                         if (rs.EOF == false)
                         {
                             //配置路径
                             String strBasePath = System.Configuration.ConfigurationManager.AppSettings["SoftWarePath"];
                             strBasePath = System.IO.Path.Combine(this.GetCurrentDirectory(), strBasePath);
                             strBasePath = 得到小软件文件夹路径();

                             //strBasePath = System.IO.Path.Combine(strBasePath, rs.Fields["FolderPath"].Value.ToString());
                             strBasePath = System.IO.Path.Combine(strBasePath, rs.Fields["FileName"].Value.ToString());

                             if (System.IO.File.Exists(strBasePath))
                             {

                                 System.IO.FileInfo fi = new System.IO.FileInfo(strBasePath);

                                 if (_软件大小)
                                 {
                                     double length = 0;
                                     foreach (System.IO.FileInfo fif in fi.Directory.GetFiles("*.*", System.IO.SearchOption.AllDirectories))
                                     {
                                         length += fif.Length;
                                     }
                                     this.lstView.MyDataView1["大小", i].Value = (length / (1024 * 1024)).ToString("#########0.00") + "MB";
                                 }
                                
                                 try
                                 {
                                     if (_软件图标)
                                     {
                                         Icon ic = Icon.ExtractAssociatedIcon(fi.FullName);
                                         this.lstView.MyDataView1["图标", i].Value = ic.ToBitmap() as Image;
                                     }
                                 }
                                 catch (Exception me)
                                 {
                                     UTIL.CException.SaveExcepiton(UTIL.ErrorType.Error, me, MethodBase.GetCurrentMethod().GetType());
                                 }

                             }

                             rs.Close();
                         }
                     }
                     rs = null;                    
                 }
             }
             catch (Exception me)
             {
                 UTIL.CException.SaveExcepiton(UTIL.ErrorType.Error, me, MethodBase.GetCurrentMethod().GetType());//A-2009-10-11 
             }             
         }

         private void lstView_ItemDoubleClickRefreshData(string strId, ref bool bState)
         {           
             if (!strFilePath.ToLower().EndsWith(".jar"))
             {
                 UTIL.CUtil.OpenFile(strFilePath); //A-2009-10-07
             }
             else
             {
                 UTIL.CUtil.OpenFile(System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("JAVA_HOME", EnvironmentVariableTarget.Machine), @"bin\java.exe"), " -jar " + strFilePath); //A-2009-10-07
             }

             //2010-04-11 打开时记录最后一次打开功能           
             String strSql2 = "update XscSoftWare set LastOpenTime=?  where id='" + this.strId + "'";
             ADODB.Command cmd = new ADODB.Command();
             cmd.CommandText = strSql2;
             ADODB.Parameter pa = cmd.CreateParameter("", ADODB.DataTypeEnum.adDBTimeStamp, ADODB.ParameterDirectionEnum.adParamInput, -1, DateTime.Now.ToString());
             cmd.Parameters.Append(pa);
             ct.ExcCommand(cmd);
             //2010-04-11 打开时记录最后一次打开功能
         }   

         private void btnSecectFolder_Click(object sender, EventArgs e)
         {

         }

         #region 电子书选择 2010-04-05    

         public void RefreshEBook(String strFile,String IsSingle)
         {
             btn扩展.Visible = false;
             if (IsSingle != "1")
             {
                 return;
             }
             if (System.IO.File.Exists(strFile))
             {                 
                 String strExt = System.IO.Path.GetExtension(strFile).ToUpper();
                 if (strExt == ".PDF" || strExt == ".PDG" || strExt == ".TXT" || strExt == ".DOC" || strExt == ".XST" || strExt == ".PPT" || strExt == ".CHM")
                 {
                     String strDir = System.IO.Path.GetDirectoryName(strFile);
                     System.IO.DirectoryInfo dif = new DirectoryInfo(strDir);
                     if (dif.GetFiles().Length > 1)
                     {
                         btn扩展.Visible = true;
                     }
                 }
                 btn扩展.Tag = strFile;
             }           
         }

         private void myButton1_Click(object sender, EventArgs e)
         {
             if(btn扩展.Enabled)
             {
                 using (SelectedForm frm = new SelectedForm())
                 {
                     if (btn扩展.Tag != null)
                     {
                         frm.文件夹路径 = btn扩展.Tag.ToString();
                         frm.ShowDialog();
                     }
                 }
             }
         }

         #endregion

         #region 重载窗体数据保存 2010-09-06
         public override void 保存窗体数据到数据库(ref DataTable dtData)
         {
             dtData.Rows.Add(new string[] {"软件类型","Tag",cboSoftWareType.Tag.ToString()});
             dtData.Rows.Add(new string[] { "软件类型", "Text", cboSoftWareType.Text.ToString() });
         }
         public override void 存取数据库数据到窗体(DataTable dtDbData)
         {
             if (dtDbData.Rows.Count > 0)
             {
                 cboSoftWareType.Tag = this.查找数据("软件类型", "Tag", "", ref dtDbData);
                 cboSoftWareType.Text = this.查找数据("软件类型", "Text", "", ref dtDbData);
             }
         }              
         #endregion       

        #region 设置单元格行数
         public override int 初始行数()
         {
             return this.lstView.PageSize;
         }
         public override void 设置窗体数据行数()
         {
             this.lstView.PageSize = Get窗体行数(lstView.PageSize);
         }
         public override bool 是否显示设置窗体数据行数()
         {
             return true;
         }
        #endregion

         private void btnJRE_Click(object sender, EventArgs e)
         {
             String strExportDll = System.IO.Path.Combine(this.GetCurrentDirectory(), @"ImportDll\SetJavaEnvirment\SetJavaEnvirment.exe");
             String strJava = System.IO.Path.Combine(this.GetCurrentDirectory(), @"jdk1.6.0");
             String strJavaBin = System.IO.Path.Combine(this.GetCurrentDirectory(), @"jdk1.6.0\bin");
             String strJavaLib = @".;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar";
             if (System.IO.File.Exists(strExportDll))
             {
                 using (Process po = new Process())
                 {
                     po.StartInfo.FileName  = strExportDll;
                     po.StartInfo.UseShellExecute = true;
                     po.StartInfo.Arguments = " "+strJava;
                     po.Start();
                 }
                 return;
             }
             //             
             if (System.IO.Directory.Exists(strJava))
             {
                 //JAVA_HOME
                 //CLASSPATH
                 //PATH
                 String strPathValue = System.Environment.GetEnvironmentVariable("path");
                 if (!strPathValue.ToLower().Contains(strJavaBin.ToLower()))
                 {
                     strPathValue = strJavaBin + ";" + strPathValue;
                     System.Environment.SetEnvironmentVariable("path", strPathValue, EnvironmentVariableTarget.Machine);
                 }
                 System.Environment.SetEnvironmentVariable("JAVA_HOME", strJava, EnvironmentVariableTarget.Machine);
                 System.Environment.SetEnvironmentVariable("CLASSPATH", strJavaLib, EnvironmentVariableTarget.Machine);
                 ShowMessageBox("设置成功");
             }
         }

         private void btn扩展1_Click(object sender, EventArgs e)
         {
             if (this.btn扩展1.Text == ">>")
             {
                 this.Width = 564;
                 this.btn扩展1.Text = "<<";
             }
             else if (this.btn扩展1.Text == "<<")
             {
                 this.Width = 256;
                 this.btn扩展1.Text = ">>";
             }
         }

         private void button1_Click(object sender, EventArgs e)
         {
             try
             {
                 if (ShowMessageResult("此操作可能发生不可逆转的结果，是否继续？") !=DialogResult.Yes)
                 {
                     return;
                 }
                 String strOrgialPath = strFilePath;
                 String strCurrentPath = this.GetCurrentDirectory();
                 if (strCurrentPath.EndsWith("\\"))
                 {
                     strCurrentPath = strCurrentPath.Substring(0, strCurrentPath.Length - 1);
                 }
                 String strCurrentPath1 = this.GetAppSettingConfig("synchronizatePath");
                 if (strCurrentPath1.EndsWith("\\"))
                 {
                     strCurrentPath1 = strCurrentPath1.Substring(0, strCurrentPath.Length - 1);
                 }
                 String strTargetPath = strOrgialPath.Replace(strCurrentPath, strCurrentPath1);
                 String strPath5 = Path.GetDirectoryName(strTargetPath);
                 if (!Directory.Exists(strPath5))
                 {
                     Directory.CreateDirectory(strPath5);
                 }

                 CopyFoler(Path.GetDirectoryName(strOrgialPath), strPath5);
                 ShowMessageBox("同步成功");
             }
             catch (Exception ex)
             {
                 UTIL.CException.SaveExcepiton(UTIL.ErrorType.Error, ex, MethodBase.GetCurrentMethod().GetType());
                 ShowMessageBox("同步失败");
             }
            
         }

         private void SoftWareList_LocationChanged(object sender, EventArgs e)
         {
             if (ttf != null)
             {
                 //ttf.SetDesktopLocation(this.Left + this.Width, this.Top);
                 ttf.Left = this.Left - ttf.Width;
                 ttf.Top = this.Top;
                 //ttf.Show();
                 Application.DoEvents();
             }
         }

         private void SoftWareList_FormClosing(object sender, FormClosingEventArgs e)
         {
             if (e.CloseReason ==CloseReason.UserClosing)
             {
                 ttf.Close();
                 ttf.Dispose();
             }
         }

         private void btn同步目录文件夹_Click(object sender, EventArgs e)
         {
             try
             {
                 if (string.IsNullOrEmpty(this.strFolder同步))
                 {
                     return;
                 }
                 UTIL.CUtil.OpenFileSetFile(this.strFilePath同步, ""); //A-2010-02-14
             }
             catch (Exception me)
             {
                 UTIL.CException.SaveExcepiton(UTIL.ErrorType.Error, me, MethodBase.GetCurrentMethod().GetType());//A-2009-10-11 
             }
         }

         private void btn同步目录打开_Click(object sender, EventArgs e)
         {
             if (!this.strFilePath同步.ToLower().EndsWith(".jar"))
             {
                 UTIL.CUtil.OpenFile(strFilePath同步); //A-2009-10-07
             }
             else
             {
                 UTIL.CUtil.OpenFile(System.IO.Path.Combine(System.Environment.GetEnvironmentVariable("JAVA_HOME", EnvironmentVariableTarget.Machine), @"bin\java.exe"), " -jar " + strFilePath同步); //A-2009-10-07
             }
         }

         private void btn同步目录快捷方式_Click(object sender, EventArgs e)
         {

             if (UTIL.LnkFileClass.CreateLnkFile(strFileName, strFilePath同步, "", "", ""))
             {
                 ShowMessageBox("创建成功");
             }
             else
             {
                 ShowMessageBox("创建失败");
             }
         }

         private void btn同步目录打开内码_Click(object sender, EventArgs e)
         {
             try
             {
                 if (string.IsNullOrEmpty(strFilePath同步))
                 {
                     return;
                 }
                 DataWindowPage ob = (DataWindowPage)cboLanager.SelectedValue;
                 UTIL.CUtil.OpenFile(GetConvertCode(), "\"" + strFilePath同步 + "\"" + "  \"/L" + ob.WindowPage + "\""); //A-2009-10-07
             }
             catch (Exception)
             {

             }
         }

         private void btn同步目录快捷方式内码_Click(object sender, EventArgs e)
         {
             try
             {
                 DataWindowPage ob = (DataWindowPage)cboLanager.SelectedValue;
                 String strPath1 = GetConvertCode();
                 String strArgument = "\"" + strFilePath同步 + "\"" + "  \"/L" + ob.WindowPage + "\"";
                 if (UTIL.LnkFileClass.CreateLnkFile(strFileName, strPath1, "", strArgument, strFilePath同步))
                 {
                     ShowMessageBox("创建成功");
                 }
                 else
                 {
                     ShowMessageBox("创建失败");
                 }
             }
             catch (Exception me)
             {
                 //SaveException(me);//D-2009-10-11
                 UTIL.CException.SaveExcepiton(UTIL.ErrorType.Error, me, MethodBase.GetCurrentMethod().GetType());//A-2009-10-11 
             }
         }

         private void btn快捷方式所有同步_Click(object sender, EventArgs e)
         {
             try
             {
                 for (int i = 0; i < this.lstView.MyDataView1.Rows.Count; i++)
                 {
                     String strSql = " select * From XscSoftWare "; //A-2009-10-11    
                     strSql += "       where      XscSoftWare.Id='" + this.lstView.MyDataView1[0, i].Value.ToString() + "'";

                     ADODB.Recordset rs = ct.GetTable(strSql);
                     if (rs != null)
                     {
                         if (rs.EOF == false)
                         {
                             //配置路径
                             String strBasePath = GetAppSettingConfig("SoftWarePath");
                             strBasePath = System.IO.Path.Combine(this.GetAppSettingConfig("synchronizatePath"), strBasePath);
                             //strBasePath = System.IO.Path.Combine(strBasePath, rs.Fields["FolderPath"].Value.ToString());
                             strBasePath = System.IO.Path.Combine(strBasePath, rs.Fields["FileName"].Value.ToString());

                             if (System.IO.File.Exists(strBasePath))
                             {
                                 UTIL.LnkFileClass.CreateLnkFile(System.IO.Path.GetFileNameWithoutExtension(strBasePath), strBasePath, "", "", "");
                             }
                             rs.Close();
                         }
                     }
                     rs = null;
                 }
             }
             catch (Exception me)
             {
                 UTIL.CException.SaveExcepiton(UTIL.ErrorType.Error, me, MethodBase.GetCurrentMethod().GetType());//A-2009-10-11 
             } 
         }

         private void btn快捷方式所有内码所有_Click(object sender, EventArgs e)
         {
             try
             {
                 for (int i = 0; i < this.lstView.MyDataView1.Rows.Count; i++)
                 {
                     String strSql = " select * From XscSoftWare "; //A-2009-10-11    
                     strSql += "       where      XscSoftWare.Id='" + this.lstView.MyDataView1[0, i].Value.ToString() + "'";

                     ADODB.Recordset rs = ct.GetTable(strSql);
                     if (rs != null)
                     {
                         if (rs.EOF == false)
                         {
                             //配置路径
                             String strBasePath = System.Configuration.ConfigurationManager.AppSettings["SoftWarePath"];
                             strBasePath = System.IO.Path.Combine(this.GetCurrentDirectory(), strBasePath);
                             strBasePath = 得到小软件文件夹路径();
                             //strBasePath = System.IO.Path.Combine(strBasePath, rs.Fields["FolderPath"].Value.ToString());
                             strBasePath = System.IO.Path.Combine(strBasePath, rs.Fields["FileName"].Value.ToString());
                                                         
                             DataWindowPage ob = (DataWindowPage)cboLanager.SelectedValue;
                             String strPath1 = GetConvertCode();
                             String strArgument = "\"" + strBasePath + "\"" + "  \"/L" + ob.WindowPage + "\"";
                             UTIL.LnkFileClass.CreateLnkFile(System.IO.Path.GetFileNameWithoutExtension(strBasePath), strPath1, "", strArgument, strFilePath);
                             rs.Close();
                         }
                     }
                     rs = null;
                 }
             }
             catch (Exception me)
             {
                 UTIL.CException.SaveExcepiton(UTIL.ErrorType.Error, me, MethodBase.GetCurrentMethod().GetType());//A-2009-10-11 
             }  
         }

         private void btn快捷方式所有_Click(object sender, EventArgs e)
         {
             try
             {
              for (int i = 0; i < this.lstView.MyDataView1.Rows.Count; i++)
                 {
                     String strSql = " select * From XscSoftWare "; //A-2009-10-11    
                     strSql += "       where      XscSoftWare.Id='" + this.lstView.MyDataView1[0, i].Value.ToString() + "'";

                     ADODB.Recordset rs = ct.GetTable(strSql);
                     if (rs != null)
                     {
                         if (rs.EOF == false)
                         {
                             //配置路径
                             String strBasePath = System.Configuration.ConfigurationManager.AppSettings["SoftWarePath"];
                             strBasePath = System.IO.Path.Combine(this.GetCurrentDirectory(), strBasePath);
                             strBasePath = 得到小软件文件夹路径();
                             //strBasePath = System.IO.Path.Combine(strBasePath, rs.Fields["FolderPath"].Value.ToString());
                             strBasePath = System.IO.Path.Combine(strBasePath, rs.Fields["FileName"].Value.ToString());

                             if (System.IO.File.Exists(strBasePath))
                             {
                                 UTIL.LnkFileClass.CreateLnkFile(System.IO.Path.GetFileNameWithoutExtension(strBasePath), strBasePath, "", "", "");                               
                             }
                             rs.Close();
                         }
                     }
                     rs = null;                    
                 }
             }
             catch (Exception me)
             {
                 UTIL.CException.SaveExcepiton(UTIL.ErrorType.Error, me, MethodBase.GetCurrentMethod().GetType());//A-2009-10-11 
             }  
         }

         private void btn快捷方式内码模式所有_Click(object sender, EventArgs e)
         {
             try
             {
              for (int i = 0; i < this.lstView.MyDataView1.Rows.Count; i++)
                 {
                     String strSql = " select * From XscSoftWare "; //A-2009-10-11    
                     strSql += "       where      XscSoftWare.Id='" + this.lstView.MyDataView1[0, i].Value.ToString() + "'";

                     ADODB.Recordset rs = ct.GetTable(strSql);
                     if (rs != null)
                     {
                         if (rs.EOF == false)
                         {
                             //配置路径
                             String strBasePath = System.Configuration.ConfigurationManager.AppSettings["SoftWarePath"];
                             strBasePath = System.IO.Path.Combine(this.GetCurrentDirectory(), strBasePath);
                             //strBasePath = System.IO.Path.Combine(strBasePath, rs.Fields["FolderPath"].Value.ToString());
                             strBasePath = System.IO.Path.Combine(strBasePath, rs.Fields["FileName"].Value.ToString());

                             DataWindowPage ob = (DataWindowPage)cboLanager.SelectedValue;
                            String strPath1 = GetConvertCode();
                            String strArgument= "\"" + strBasePath + "\"" + "  \"/L" + ob.WindowPage + "\"";
                            UTIL.LnkFileClass.CreateLnkFile(System.IO.Path.GetFileNameWithoutExtension(strBasePath), strPath1, "", strArgument, strFilePath);
                            rs.Close();
                         }
                     }
                     rs = null;                    
                 }
             }
             catch (Exception me)
             {
                 UTIL.CException.SaveExcepiton(UTIL.ErrorType.Error, me, MethodBase.GetCurrentMethod().GetType());//A-2009-10-11 
             } 
         }
         private String 得到小软件文件夹路径()
         {
             if (this.GetAppSettingConfig("SoftWarePathMode") == "1")
             {
                 return GetAppSettingConfig("SoftWarePathOut");
             }
             else
             {
                 return Path.Combine(this.GetCurrentDirectory(), this.GetAppSettingConfig("SoftWarePath"));
             }
         }
         //protected override void OnMouseMove(MouseEventArgs e)
         //{
         //    if (ttf != null)
         //    {
         //        ttf.SetDesktopLocation(this.Left + this.Width, this.Top);
         //        //ttf.Left = this.Left - ttf.Width;
         //        //ttf.Top = this.Top;
         //        //ttf.Show(this.Owner);
         //        Application.DoEvents();
         //    }
         //    base.OnMouseMove(e);
         //}

    }
}
